import java.awt.Graphics;
import java.awt.Rectangle;
import java.util.ArrayList;


public class BlockDump {
	private volatile ArrayList<BlockSprite> blocks;
	
	public BlockDump(){
		blocks = new ArrayList<BlockSprite>();
	}
	
	public boolean contains(Rectangle comparator){
		for(BlockSprite block : blocks){
			if(block.getMyRectangle().intersects(comparator)){
				return true;
			}
		}
		return false;
	}
	
	public BlockSprite containsHit(Rectangle comparator){
		for(BlockSprite block : blocks){
			if(block.getMyRectangle().intersects(comparator)){
				return block;
			}
		}
		return null;
	}
	
	public void add(BlockSprite bs){
		blocks.add(bs);
	}

	public void drawBlocks(Graphics dbg) {
		for(BlockSprite block : blocks){
			block.drawSprite(dbg);
		}
		
	}
}
